package Homework_03_31;

class Phone
{
    private String brand;
    private String type;
    private String os;
    private double price;
    private double memory;

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getOs() {
        return os;
    }

    public void setOs(String os) {
        this.os = os;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getMemory() {
        return memory;
    }

    public void setMemory(double memory) {
        this.memory = memory;
    }

    public Phone(String brand, String type, String os, double price, double memory) {
        this.brand = brand;
        this.type = type;
        this.os = os;
        this.price = price;
        this.memory = memory;
    }

    public Phone() {
    }

    public void Print()
    {
        //打印手机的信息
        System.out.println("品牌:" + brand);
        System.out.println("型号:" + type);
        System.out.println("操作系统:" + os);
        System.out.println("价格:" + price);
        System.out.println("内存:" + memory);
    }

    public void call(String number)
    {
        System.out.println(">>拨号");
        String callPerson = null;

        switch(number)
        {
            case "1":
                callPerson = "打电话给爷爷";
                break;
            case "2":
                callPerson = "打电话给奶奶";
                break;
            case "3":
                callPerson = "打电话给叔叔";
                break;
        }
        System.out.println(callPerson);
    }

    public void playGame(String game)
    {
        System.out.println("玩" + game);
    }

    public void playMusic(String song)
    {
        System.out.println("播放:" + song);
    }
}



public class Main7 {
    public static void main(String[] args) {
        Phone p1 = new Phone("华为","荣耀8","安卓",3666,256);
        Phone p2 = new Phone("Apple","iPhone 13","ios",8999,512);

        p1.Print();
        System.out.println("---------------------------------");
        p1.call("1");
        p1.playGame("王者荣耀");
        p1.playMusic("搁浅");

        System.out.println("=============================");
        p2.Print();
        System.out.println("----------------------------------");
        p2.call("3");
        p2.playGame("蛋仔派对");
        p2.playMusic("好运来");
    }
}
